<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>跳转中....</title>
</head>
<body>
<script th:inline="javascript">
  (function () {
    function getBrowserName() {
      const userAgent = navigator.userAgent;
      if (userAgent.includes("Chrome")) {
        return "Google Chrome";
      } else if (userAgent.includes("Edg")) {
        return "Microsoft Edge";
      } else if (userAgent.includes("Firefox")) {
        return "Mozilla Firefox";
      } else if (userAgent.includes("Safari") && !userAgent.includes("Chrome")) {
        return "Apple Safari";
      } else if (userAgent.includes("Opera") || userAgent.includes("OPR")) {
        return "Opera";
      } else {
        return "Unknown Browser";
      }
    }
    function getDeviceName() {
      const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
      if (isMobile) {
        return '移动端';
      } else {
        return '网页';
      }
    }
    function getOperatingSystem() {
      const userAgent = navigator.userAgent;
      if (userAgent.includes("Windows NT 10.0")) {
        return "Windows 10";
      } else if (userAgent.includes("Windows NT 6.2")) {
        return "Windows 8";
      } else if (userAgent.includes("Windows NT 6.1")) {
        return "Windows 7";
      } else if (userAgent.includes("Windows NT 6.0")) {
        return "Windows Vista";
      } else if (userAgent.includes("Windows NT 5.1")) {
        return "Windows XP";
      } else if (userAgent.includes("Windows NT 5.0")) {
        return "Windows 2000";
      } else if (userAgent.match(/Macintosh/i)) {
        return 'Mac';
      } else if (userAgent.match(/Android/i)) {
        return 'Android';
      } else if (userAgent.match(/iPhone|iPad|iPod/i)) {
        return 'iOS';
      } else if (userAgent.match(/Windows/i)) {
        return 'Windows';
      } else if (userAgent.match(/Linux/i)) {
        return 'Linux';
      } else {
        return "Unknown Operating System";
      }
    }

    const code = /*[[ ${code} ]]*/ '';

    location.href = './device-info/get?browser=' + getBrowserName()
      + '&source=' + getDeviceName() + '&system=' + getOperatingSystem()
      + '&code=' + code;
  })();
</script>
</body>
</html>